#!/bin/bash
   #chkconfig: 345 95 50
   #description: Starts xvfb on display 99
   if [ -z "$1" ]; then
   echo "`basename $0` {start|stop}"
       exit
   fi

   case "$1" in
   start)
       /usr/bin/Xvfb :99 -screen 0 1440x1440x24 1>/dev/null 2>&1 &
       echo $! > /var/run/Xvfb.pid
   ;;

   stop)
      if [ -f /var/run/Xvfb.pid ]; then
	pid=`cat /var/run/Xvfb.pid`
        kill -9 ${pid} > /dev/null
      fi
   ;;
   esac
